﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using DemoInterface;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Reflection;
using System.Configuration;


namespace WinFormForMEFDemo
{
    static class Program
    {

        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            OperIoc oi = new OperIoc();
            oi.Init();
            Form frm = null;
            if ((oi.Iformfrm != null) && (oi.Iformfrm.Length > 0))
            {
                frm = oi.Iformfrm.Where(t => t.Title.Equals(ConfigurationManager.AppSettings["CurrentMain"].ToString())).FirstOrDefault() as Form;
                if (frm != null)
                    Application.Run(frm);
            }
        }
    }
}
